package com.zju.DoctorGo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zju.DoctorGo.entity.Prescription;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface PrescriptionMapper extends BaseMapper<Prescription> {

    List<Prescription> getPrescriptions();

    Integer updatePrescription(Prescription prescription);

    Integer deletePrescription(Long id);

    Integer addPrescription(Prescription prescription);

    List<Prescription> getPrescriptionsByPrescriptionId(Long prescriptionId);

    List<Prescription> getPrescriptionById(Long id);

    Integer updatePrescriptionItem(@Param("prescriptionId") Long prescriptionId,
                                   @Param("medicineId") Long medicineId,
                                   @Param("quantity") int quantity);

    Integer deletePrescriptionItem(@Param("prescriptionId") Long prescriptionId,
                                   @Param("medicineId") Long medicineId);

    Integer insertPrescriptionItem(@Param("prescriptionId") Long prescriptionId,
                                   @Param("medicineId") Long medicineId,
                                   @Param("quantity") int quantity);
}
